{% load i18n %} 
{% for topic in topics.object_list %}
{% if not topic.conversation %}
	{% if topic.dailyreport %}
	<div class="topic-all darkback">
	{% else %}
	<div class="topic-all">
	{% endif %}
		<div class="topic-left">
			<div class="topic-author">
				<div class="topic-author-protrait">
					<img class="box-shadow-dark" src="{{ topic.author.get_profile.gen_protrait }}" width="50" height="50"/>
				</div>
				<div class="topic-author-nickname">
					<a href="/member/{{ topic.author.username }}/">{{ topic.author.get_profile.realname }}</a>
				</div>
			</div>
		</div>
		<div class="topic-right">
			<div class="topic-meta">
				<span class="topic-datetime">{{topic.created|date:"Y-m-d"}} {{topic.created|date:"l"}} 发表于{{ topic.created|timesince }}之前</span>
				{% if user.is_authenticated %}
				<span class="topic-control">
					<ul>
						{% ifequal page_type 'self' %}
						<li class="conversation"><button title="修改" class="topic-modify" value="{{topic.id}}" type="button"></button></li>
						<li class="conversation"><button title="删除" class="topic-delete" value="{{topic.id}}" type="button"></button></li>
						{% endifequal %}
						<li class="conversation"><button title="收藏" class="favbtn {%if user in topic.get_fav_users %}fav{% else %}unfav{% endif %}" value="{{topic.id}}" type="button"></button></li>
						<li class="conversation"><button title="回复" class="topic-reply" value="{{topic.id}}" type="button"><!--{% trans 'Reply' %}--></button></li>
					</ul>
				</span>
				{% endif %}
			</div>
			<div class="topic-content-wrap">
				<div class="topic-content">
					<div class="content">
						{{ topic.content }}
					</div>
					{% for topic_c in  topic.topic_set.all %}
					<div class="topic-content-conversation">
						<span><a href="/member/{{ topic_c.author.username }}/">{{ topic_c.author.get_profile.realname }}</a></span><span>{% trans 'Say' %}:</span><span>{{ topic_c.content }}</span>
					</div>
					{% endfor %}
				</div>
				<div class='conversation-form box-shadow'>
					<input type='text' name='conversation'/>
					<input type='hidden' name='topic-id' value='{{ topic.id }}'/>
					<button type="button" class="conversation-button button orange">{% trans 'Submit' %}</button>
					<div class="closebtn"></div>
				</div>
				<div class='modify-form box-shadow'>
					<input type='text' name='conversation'/>
					<input type='hidden' name='topic-id' value='{{ topic.id }}'/>
					<button type="button" class="modify-button button orange">{% trans 'Submit' %}</button>
					<div class="closebtn"></div>
				</div>
			</div>
		</div>
		<div class="clearfix"></div>
	</div>
{% endif %}
{% empty %}
<div class="no-topic">
	<h4>{% trans 'No topic has been posted yet.' %}</h4>
</div>
{% endfor %}